package com.zeei.ems.meet.controller;

import com.zeei.ems.base.constant.GlobalConstant;
import com.zeei.ems.base.controller.BasicController;
import com.zeei.ems.base.result.ResultRowsVO;
import com.zeei.ems.meet.model.PointPositionVO;
import com.zeei.ems.meet.model.vo.PointPositionParam;
import com.zeei.ems.meet.service.PointPositionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "车辆经纬度管理接口")
@RestController
@RequestMapping("/ems/point/position")
public class PointPositionController extends BasicController {
    @Autowired
    PointPositionService pointPositionService;

    /**
     * 查询车辆经纬度信息列表
     * @param pointPosition 车辆经纬度信息
     * @return 返回车辆经纬度信息列表
     */
    @ApiOperation(value = "查询车辆经纬度信息列表")
    @PostMapping("/page/list")
    public ResultRowsVO<PointPositionVO> listPointPosition(@RequestBody PointPositionParam pointPosition){
        List<PointPositionVO> pointPositionList = pointPositionService.listPointPosition(pointPosition);
        return this.createResultRowsVO(pointPositionList, GlobalConstant.SUCCEED, pointPositionList.size());
    }
}
